﻿using System.ComponentModel;
using System.Windows.Forms;
using UtfprLibrary.ComponentModel;
using UtfprLibrary.ComponentModel.Security;
using System.Drawing.Design;
using System;

namespace UtfprLibrary.Windows.Forms {
    public class UtfprLogWindowBase : UserControl, IUtfprControl, IUtfprControlProvider {
        #region Core

        #region UtfprControlService (IUtfprControl, IUtfprControlProvider)

        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool UtfprControlEnabled {
            get { return this.Enabled; }
            set { this.Enabled = value; }
        }

        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool UtfprControlVisible {
            get { return this.Visible; }
            set { this.Visible = value; }
        }

        private IUtfprKeyName _functionOrOperation = null;
        [Category("Security"), Description("If IsFunction is true, loads a Function, otherwise loads an Operation")]
        [Editor("UtfprLibrary.Windows.Forms.ComponentModel.UtfprRestrictionEditor, UtfprLibrary.WindowsForms.Design", typeof(UITypeEditor))]
        public IUtfprKeyName FunctionOrOperationRestriction {
            get { return _functionOrOperation; }
            set { _functionOrOperation = value; }
        }

        private UtfprControlBase _utfprControlBase;
        [Browsable(false)]
        public UtfprControlBase UtfprControlBase {
            get {
                if (_utfprControlBase == null) {
                    _utfprControlBase = new UtfprControlBase(this);
                }
                return _utfprControlBase;
            }
        }

        #endregion

        #endregion

        #region ToOverride

        public virtual void ShowInfo(string title, string message) { 
            throw new NotImplementedException(); 
        }

        public virtual void ShowResult(string title, string message) { 
            throw new NotImplementedException(); 
        }

        public virtual void ShowError(string title, string message) { 
            throw new NotImplementedException();  
        }

        #endregion
    }
}
